package com.hs.sfzy.mapper;

import com.hs.sfzy.entity.Appointment;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author qin
* @description 针对表【appointment】的数据库操作Mapper
* @createDate 2024-10-24 17:10:49
* @Entity com.hs.sfzy.entity.Appointment
*/
public interface AppointmentMapper {

    /**
     *  动态查询预约信息
     * @author QinKunPeng
     * @date 2024/10/24 17:41
     * @return java.util.List<com.hs.sfzy.entity.Appointment>
     */
    List<Appointment> getAppointments(Map map);

    /**
     * 根据id查询咨询预约
     * @author QinKunPeng
     * @date 2024/10/24 19:08
     * @param id
     * @return com.hs.sfzy.entity.Appointment
     */
    Appointment getAppointment(long id);

    /**
     * 根据id删除预约
     * @author QinKunPeng
     * @date 2024/10/24 17:50
     * @param id
     * @return int
     */
    int deleteAppointment(long id);

    /**
     * 新增预约信息【微信小程序端】
     * @author QinKunPeng
     * @date 2024/10/24 17:52
     * @param appointment
     * @return int
     */
    int insertAppointment(Appointment appointment);

    /**
     * 修改预约信息【用于咨询师回复】
     * @author QinKunPeng
     * @date 2024/10/24 17:55
     * @param appointment
     * @return int
     */
    int updateAppointment(Appointment appointment);

    @Select("select * from appointment where status = 3")
    List<Appointment> findAllY();

    @Select("select * from appointment where status = 2" )
    List<Appointment> findAllW();
}
